<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

namespace builder\form\util\control;

/**
 * 不显示的控件
 * @author cleverstone
 * @since ym2.0
 */
class Hidden extends Control
{
    /**
     * @var array
     */
    private $_options = [
        'control' => 'hidden',
        'default' => '',
    ];

    /**
     * 默认值
     * @param string $default
     * @return $this
     */
    public function defaultValue($default)
    {
        $this->_options['default'] = (string)$default;
        return $this;
    }

    /**
     * @return array
     */
    public function _toArray()
    {
        return $this->_options;
    }
}